package net.neptech.model.appointment;

import jakarta.persistence.*;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import net.neptech.utils.SnowflakeIdGenerator;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.GenericGenerator;

import java.time.Instant;
import java.util.Date;

@Data
@Entity
@Accessors(chain = true)
@Table(name = "clnic_staff", uniqueConstraints = @UniqueConstraint(
        name = "uk_staff_dept_date_type_period",
        columnNames = {"staff_id","dept_id","clnic_time","type_id","period"}
))
public class ClnicStaff {
    @Id
    @GeneratedValue(generator = "snowflake")
    @GenericGenerator(name = "snowflake",type = SnowflakeIdGenerator.class)
    @Comment("坐诊id")
    @Column(name = "id", nullable = false)
    private Long id;


    @Comment("坐诊日期")
    @Column(name = "clnic_time", nullable = false)
    private Date clnicTime;


    @Comment("医生id")
    @Column(name = "staff_id", nullable = false)
    private Long staffId;


    @Comment("1.上午|2.下午")
    @Column(name = "period")
    private String period;

    @Comment("0.线上排班/1.线下排班")
    @ColumnDefault("1")
    @Column(name = "type_id")
    private Integer typeId;

    @Comment("总号量")
    @ColumnDefault("0")
    @Column(name = "slot_total")
    private Integer slotTotal;

    @Comment("已使用号")
    @ColumnDefault("0")
    @Column(name = "slot_use")
    private Integer slotUse;

    @Comment("0.正常1.停诊")
    @Column(name = "status")
    private Integer status;

    @Comment("科室id")
    @Column(name="dept_id")
    private Long deptId;


    @Column(name = "create_at")
    private Date createAt;


    @Column(name = "update_at")
    private Date updateAt;

}